The phrase "to count the cost" means to carefully consider the consequences or sacrifices that come with a particular action or decision before proceeding.
Sentences with «to count the cost»
If you don't count the cost of the purchases this organized wall of shopping bags is free! (remodelaholic.com)
That's not counting the cost of packing materials, additional help, or closing out old bills before leaving. (lendedu.com)
You started building a tower but didn't count the costs before you did, leaving a half built tower. (religion.blogs.cnn.com)